All code is in MATLAB.

The code in the file Table1.m generates the numbers reported in Table 1 in the paper. 

The code in the file Table2.m generates the numbers reported in Table 2 in the paper. 

The code in the file Table3.m generates the numbers reported in Table 3 in the paper. 

Figure 1 and Tables 4-8 in the paper involve proprietary data that cannot be shared per agreement with the company. Following the Editor's suggestion, we generated a synthetic dataset following the steps described below, and included code to produce the results corresponding to those in Figure 1 and Tables 4-8 based on this synthetic dataset. The synthetic dataset and the code for generating and analyzing it help illustrate our methodology. Of course, the specific outputs produced based on the synthetic dataset are different from the corresponding tables in the paper. 

The steps are as follows. 

Step 1.

The dataset underlying Figure 1 and Tables 4-8 in the paper consisted of 461187 observations, with each observation corresponding to a single "keyword" that advertisers bid on. (Note that "keyword" here can refer both to single words like "mortgage" and to commonly searched phrases like "car insurance".) The synthetic dataset that we use likewise contains 461187 synthetic entries, which we will subsequently call "keywords". To build these entries, we start with the file synth-core.csv. This file describes the parameters of a hypothetical economy for which we assume that we know "the ground truth" and will then simulate various magnitudes that would be observed by the econometrician prior to the experiment and afterwards. 

For each "keyword", the file synth-core.csv includes the following (comma-separated) parameters:
- the ex ante number of potential bidders for that keyword 
- the mean of the ex ante distribution of values of advertisers for this keyword
- the standard deviation of the ex ante distribution of values of advertisers for this keyword
- whether the keyword is in the control group ("0") or in the treatment group ("1")
- the number of searches for this keyword pre-intervention
- the number of searches for this keyword post-intervention
- the normalized click-through rate for this keyword (i.e., the probability that a user will click on an ad for this keyword that is placed in the top position on the screen)

Note that the first three variables in the file synth-core.csv contain values that are not observable in raw data, i.e., the true number of potential bidders (including those with valuations below the reserve price) and the true mean and standard deviation of the distribution of bidder valuations (which need to be inferred, since the Generalized Second-Price Auction is not incentive compatible, and thus the observed bids are generally different from bidders’ valuations). The values of those parameters in synth-core.csv were generated in such a way that the resulting full synthetic dataset (whose subsequent construction is described below) would be broadly similar to the actual underlying proprietary dataset, while being sufficiently different from it to protect the proprietary dataset's confidentiality. 

Step 2. 

The code in the file genpre.m loads the keyword parameters from the file synth-core.csv, and based on them, simulates the data that would be observed pre-intervention. The resulting dataset is saved in the comma-delimited file synthpre.txt and the machine-readable file synthpre.mat. The dataset includes the original data from synth-core.csv, and adds the following variables for each keyword:
- the average realized number of bidders (generally lower than the potential number of bidders due to the 0.10 pre-intervention reserve price that may price out some of the bidders)
- the average mean of the bids for the keyword (excluding the top bid)
- the average standard deviation of the bids for the keyword (excluding the top bid)
- the average revenue-per-search (rps) for this keyword implied by these bids and the keyword’s click-through rate

Step 3.

The next piece of code, in the file genlookup.m, generates the "lookup table" analogous to the one described in Section 4.1 of the paper ("The next step was to simulate the three moments (observed number of bidders, average bid in positions 2 and below, and the standard deviation of the bids in positions 2 and below) for various true values of the number of potential bidders and the mean and the standard deviation of the lognormal distribution of values. To do that, for each combination of true values of the variables of interest, several hundred draws of the vectors of bidder values were drawn. For each draw, equilibrium bids were computed, taking into account the 10 cents reserve price and assuming that the bidders were playing the bidder-optimal locally envy-free equilibrium of the Generalized Second-Price Auction. The moments of interest were then computed, and averaged over all draws of vectors of bidder values.") The resulting lookup table is saved in lookupt.txt and lookup.mat. 

The code in the file Table4andFigure1.m produces the estimated optimal reserve price for each keyword, by continuing to follow the procedure described in Section 4.1 ("For each keyword, the number of bidders and the parameters of the distribution of bidder values were then estimated by matching the observed moments to the simulated ones. Note that the number of bidders is irrelevant for setting the optimal reserve price, but it needs to be estimated in order to get an accurate estimate of the mean and the standard deviation of the distribution of values. Finally, for each keyword, the theoretically optimal reserve price was computed using the formula in Section 3.") The code then appends these estimated reserve prices to the dataset. The resulting dataset is saved in the files estrp.txt and estrp.mat. 

The files genlookup.m and Table4andFigure1.m are simplified versions of the production code of the estimation procedure used by the company.

The file Table5.m generates the numbers corresponding to those reported in Table 5 of the paper, based on the synthetic dataset. 

Step 4.

The final piece of the synthetic dataset (used to analyze synthetic post-intervention results) is generated by the file genpost.m, which sets the reserve prices according to the procedure described in the paper (keeping it at 10 cents for keywords in the control group, and setting it equal to the midpoint between 10 cents and the estimated optimal reserve price for keywords in the treatment group), and then generates "post-intervention" data in the same way as how the code in genpre.m generates pre-intervention data, but with the new reserve price instead of the old one. The output is saved in the files finalDataSet.txt and finalDataSet.mat.

The code in the file Tables678.m generates the numbers corresponding to those reported in Tables 6, 7, and 8 of the paper, based on the synthetic dataset. 
